#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QDebug>
#include <wtire_thread.h>
#include <read_thread.h>
#include <QReadWriteLock>
#include <QWaitCondition>
#include <QCloseEvent>
namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

private slots:
    void on_pushButton_clicked();
protected:
    void closeEvent(QCloseEvent *event);
private:
    Ui::Widget *ui;
    wtire_thread wthread;
    read_thread rthred1,rthread2;
    bool flag;
    QString msg;
    QReadWriteLock rwlock;
    QWaitCondition cond;
};

#endif // WIDGET_H
